{extend name="index/index" /}
{block name="index"}
        <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                未通过审核
            </div>
            <ol class="am-breadcrumb">
                <li><a href="{:url('admin/index/index')}" class="am-icon-home">首页</a></li>
                <!-- <li><a href="#">Amaze UI CSS</a></li> -->
                <li class="am-active">未通过审核</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                    </div>
                    <div class="tpl-portlet-input tpl-fz-ml">
                        <div class="portlet-input input-small input-inline">
                            
                        </div>
                    </div>


                </div>
                <div class="tpl-block">
                    <div class="am-g">
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                </div>
                            </div>
                        </div>
                        
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-input-group am-input-group-sm">
                                <form action="{:url('admin/Examine/index')}">
                                    <input type="text" name="title" class="am-form-field" style="width: 185px" placeholder="请输入图片名">
                                    <span class="am-input-group-btn">
                                        <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit"></button>
                                    </span>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                            <form class="am-form">
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                        <tr>
                                            <th class="table-id">ID</th>
                                            <th class="table-title">图片名</th>
                                            <th class="table-title">上传的图片</th>
                                            <th class="table-title">状态</th>
                                            <th class="table-title">审核</th>


                                            <th class="table-set"></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {empty name="data"}
                                    <tr><td colspan="6" align="center">暂无数据</td></tr>
                                    {else /}
                                    {volist name="data" id="v"}
                                    <tr>
                                        <td>{$v['id']}</td>
                                        <td>{$v['title']}</td>
                                        <td><img src="http://pn5tyoo5a.bkt.clouddn.com/{$v.src}"
                                                 width="130" height="160"></td>

                                        <td>
                                            {if condition="$v.status == '1'"}
                                            <font color="red">等待审核...</font>
                                            {else /}
                                                {if condition="$v.status == '2'"}
                                                <font color="green">审核通过</font>
                                                {else /}
                                                <font color="red">审核未通过</font>
                                                {/if}
                                            {/if}
                                        </td>

                                        <td>
                                            <div class="am-btn-toolbar">
                                                <div class="am-btn-group am-btn-group-xs"><a href="javascript:void(0)" class="am-btn am-btn-default am-btn-xs am-text-secondary" style="background: white;color:skyblue" onclick="pass(this,{$v['id']})"><span class="am-icon-pencil-square-o">

                                                <span class="am-icon-copy"></span>通过</button></a>


                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    {/volist}
                                    {/empty}
                                    </tbody>
                                </table>
                                <div class="am-cf">

                                    <div class="am-fr">
                                        {$page}
                                    </div>
                                </div>
                                <hr>

                            </form>
                        </div>

                    </div>
                </div>
                <div class="tpl-alert"></div>
            </div>

        </div>
    <script src="/static/admin/assets/js/jquery-1.8.3.min.js"></script>
    <script>
            function pass(obj,id){

                $.ajax({
                    url:"/examine_pass",
                    Type:'get',
                    data:{id:id},
                    dataType:'json',
                    success:function(data){

                      if (data.status) {
                        
                          toastr.success(data.msg);
                          window.location.reload();

                      } else {
                          toastr.error(data.msg);
                      }

                    },
                    error:function(data){
                        toastr.error('系统故障,请联系管理员');
                    }
                });


            }


    </script>

{/block}
